package com.hubu.core;
/**
 *
 * 每个database对应一颗B+树
 */
public class Database{
    public int size(){
        return tree.size();
    }
    private BPlusTree<String,String> tree=null;
    private String name;
    public Database(String name){
        //check name
        this.name=name;

        //创建树
        tree=new BPlusTree<>(100);
    }
    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "Database{" +
                "name='" + name + '\'' +
                '}';
    }



    public String put(String key,String value){
        return tree.put(key,value);
    }
    public String get(String key) {
        return tree.get(key);
    }
    public void set(String key, String value) {
        tree.put(key,value);
    }


    public String delete(String key) {
        return tree.remove(key);
    }
}
